From 5482856d38a8311d0c24aee2c0ad1f2bf68eb7bc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 15 Aug 2023 14:04:06 +0000 Subject: [PATCH 01/32] Upgrade to v0.11.0 --- conf/arm64.src | 6 +++--- conf/armv6.src | 6 +++--- conf/armv7.src | 6 +++--- conf/i386.src | 6 +++--- conf/x86-64.src | 6 +++--- manifest.json | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/conf/arm64.src b/conf/arm64.src index 9ef742d..bb13f44 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.10.0/gotosocial_0.10.0_linux_arm64.tar.gz -SOURCE_SUM=90238812b8e398f09c4a42a5b4347e932ea632f921f5b81d6896f35fd032ea0f +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_arm64.tar.gz +SOURCE_SUM=c0483b53200b7af7bb3d02f2eacd22780deb2ba20ca246bc62198fe18c05f11b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.10.0_linux_arm64.tar.gz +SOURCE_FILENAME=gotosocial_0.11.0_linux_arm64.tar.gz diff --git a/conf/armv6.src b/conf/armv6.src index 39cd7e6..f6924d2 100644 --- a/conf/armv6.src +++ b/conf/armv6.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.10.0/gotosocial_0.10.0_linux_armv6.tar.gz -SOURCE_SUM=6fd8e981722792104c035d82eb433b62b91489f9aef2bffe9ee86e4caf528b05 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_armv6.tar.gz +SOURCE_SUM=43506e27f7ced4683bd2db665176d3bf6ee761c8a46979af833890862ba74437 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.10.0_linux_armv6.tar.gz +SOURCE_FILENAME=gotosocial_0.11.0_linux_armv6.tar.gz diff --git a/conf/armv7.src b/conf/armv7.src index 5bc3ffd..8e760cd 100644 --- a/conf/armv7.src +++ b/conf/armv7.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.10.0/gotosocial_0.10.0_linux_armv7.tar.gz -SOURCE_SUM=01eaccbe8613669b78aa3995638c5c8d84ea1e2ae715192903d980c363cf687c +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_armv7.tar.gz +SOURCE_SUM=3950fcf38a0438c33307dc00e91be305a247ff965b592dd54962f359c721a3df SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.10.0_linux_armv7.tar.gz +SOURCE_FILENAME=gotosocial_0.11.0_linux_armv7.tar.gz diff --git a/conf/i386.src b/conf/i386.src index 46db766..b24a1f8 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.10.0/gotosocial_0.10.0_linux_386.tar.gz -SOURCE_SUM=4883f6f2c80535b059b4147c6f9491e13bbec9b624acf95b1893a168a50f2312 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_386.tar.gz +SOURCE_SUM=1429acce3a61580596816f26c4ce4baf4f299ac47fdd447ad4527ee8103c6a99 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.10.0_linux_386.tar.gz +SOURCE_FILENAME=gotosocial_0.11.0_linux_386.tar.gz diff --git a/conf/x86-64.src b/conf/x86-64.src index 250afee..99c442a 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.10.0/gotosocial_0.10.0_linux_amd64.tar.gz -SOURCE_SUM=1618cafe9316d60159b59287e98b4d79d3bb17c4d89ced31f3d325ab59cf5a39 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_amd64.tar.gz +SOURCE_SUM=b008350c7130388860182065d95d23feec6ea10d4c9013528ee96fd041a85804 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.10.0_linux_amd64.tar.gz +SOURCE_FILENAME=gotosocial_0.11.0_linux_amd64.tar.gz diff --git a/manifest.json b/manifest.json index d5c2c3a..ecb993a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub social network server", "fr": "Serveur de réseau social basé sur ActivityPub" }, - "version": "0.10.0~ynh1", + "version": "0.11.0~ynh1", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", @@ -106,4 +106,4 @@ } ] } -} \ No newline at end of file +} From 10272283dd567c6607ad81336331de67fa159ea3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 15 Aug 2023 14:04:12 +0000 Subject: [PATCH 02/32] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 280334c..5b42825 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,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.10.0~ynh1 +**Shipped version:** 0.11.0~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index bf541a2..37a6357 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,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.10.0~ynh1 +**Version incluse :** 0.11.0~ynh1 ## Captures d’écran From 6e1b61e60e842864c88f5c9f9e5ac562c0ae1e09 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 20:29:04 +0200 Subject: [PATCH 03/32] updating install and upgrade script with new parameters --- scripts/install | 8 +++++++- scripts/upgrade | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 4f096a4..a79e60f 100755 --- a/scripts/install +++ b/scripts/install @@ -39,6 +39,8 @@ password="$YNH_APP_ARG_PASSWORD" # Config stuff: +cache_memory_target="100MiB" + 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") @@ -50,12 +52,13 @@ 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="30" +media_remote_cache_days="7" media_emoji_local_max_size="51200" media_emoji_remote_max_size="102400" @@ -111,6 +114,8 @@ 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=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_approval_required --value="$accounts_approval_required" ynh_app_setting_set --app="$app" --key=accounts_reason_required --value="$accounts_reason_required" @@ -122,6 +127,7 @@ ynh_app_setting_set --app="$app" --key=instance_expose_suspended --value="$insta 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" diff --git a/scripts/upgrade b/scripts/upgrade index dceeffe..6f9f774 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -305,6 +305,22 @@ then ynh_app_setting_set --app="$app" --key=accounts_custom_css_length --value="$accounts_custom_css_length" fi +# Upgrade from <0.11.0~ynh1: +if ynh_compare_current_package_version --comparison lt --version 0.11.0~ynh1 || [ -z "$cache_memory_target" ] +then + # declaration of new parameter + cache_memory_target="100MiB" + instance_inject_mastodon_version="false" + # update default config + if [ "$media_remote_cache_days" == "30" ]; then + media_remote_cache_days="7" + ynh_app_setting_set --app="$app" --key=media_remote_cache_days --value="$media_remote_cache_days" + fi + # registration of parameter + ynh_app_setting_set --app="$app" --key=cache_memory_target --value="$cache_memory_target" + ynh_app_setting_set --app="$app" --key=instance_inject_mastodon_version --value="$instance_inject_mastodon_version" +fi + #================================================= # CREATE DEDICATED USER #================================================= From 866a8d30e064d74b6a33bbc7c45dfa62481295cd Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 20:29:20 +0200 Subject: [PATCH 04/32] add new parameters to the config panel --- conf/config.yaml | 4 ++-- config_panel.toml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index 653e4c7..d593c2d 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -238,7 +238,7 @@ cache: # in-memory objects, and so NOT AT ALL EXACT. # Examples: ["100MiB", "200MiB", "500MiB", "1GiB"] # Default: "100MiB" - memory-target: "100MiB" + memory-target: __CACHE_MEMORY_TARGET__ ###################### ##### WEB CONFIG ##### @@ -310,7 +310,7 @@ instance-deliver-to-shared-inboxes: __INSTANCE_DELIVER_TO_SHARED_INBOXES__ # # Options: [true, false] # Default: false -instance-inject-mastodon-version: false +instance-inject-mastodon-version: __INSTANCE_INJECT_MASTODON_VERSION__ ########################### ##### ACCOUNTS CONFIG ##### diff --git a/config_panel.toml b/config_panel.toml index 2f56854..d42b389 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -288,6 +288,22 @@ La livraison dans la boîte de réception partagée peut réduire de manière si 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:__FINALPATH__/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 ################ @@ -355,6 +371,29 @@ 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 = "cache-memory-target:__FINALPATH__/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 #################### From a4241929b65fbc0815451913b7f3df16dce9fcf2 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 20:32:46 +0200 Subject: [PATCH 05/32] adding comment --- scripts/upgrade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 6f9f774..8542a3c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -313,6 +313,8 @@ then instance_inject_mastodon_version="false" # update default config if [ "$media_remote_cache_days" == "30" ]; then + # "30" is the old default value, "7" the new one + # updating to the new default only if the old default value is used (to not overwrite an user modified value) media_remote_cache_days="7" ynh_app_setting_set --app="$app" --key=media_remote_cache_days --value="$media_remote_cache_days" fi From ab5ce2d1e9f311eba744ec3d05428a8c77ebbc37 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 21:13:45 +0200 Subject: [PATCH 06/32] fix the config panel --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index d42b389..c1b6a61 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -384,7 +384,7 @@ 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 = "cache-memory-target:__FINALPATH__/config.yaml" +bind = "memory-target:__FINALPATH__/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. From ac0b38cd884586fe8620cf6930f61079802df5cb Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 21:15:19 +0200 Subject: [PATCH 07/32] fix a comment --- conf/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index d593c2d..08678b2 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -389,7 +389,7 @@ media-description-max-chars: __MEDIA_DESCRIPTION_MAX_CHARS__ # 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. -# Examples: 7 +# Examples: [30, 60, 7, 0] # Default: 7 media-remote-cache-days: __MEDIA_REMOTE_CACHE_DAYS__ From 19fd8e697cb99bbd1eec5bdc0923a989996693ef Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 21:19:26 +0200 Subject: [PATCH 08/32] fix unbound variables --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 8542a3c..83bd7e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,11 +32,14 @@ db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) datadir=$(ynh_app_setting_get --app="$app" --key=datadir) +cache_memory_target=$(ynh_app_setting_get --app="$app" --key=cache_memory_target) + 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_web=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended_web) instance_expose_public_timeline=$(ynh_app_setting_get --app="$app" --key=instance_expose_public_timeline) instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes) +instance_inject_mastodon_version=$(ynh_app_setting_get --app="$app" --key=instance_inject_mastodon_version) 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) From 957e3070f5177a6aa30cc9c9c95868390c6ea479 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 15 Aug 2023 21:38:37 +0200 Subject: [PATCH 09/32] fix another unbound variables... --- scripts/restore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/restore b/scripts/restore index 0080665..60848ee 100755 --- a/scripts/restore +++ b/scripts/restore @@ -44,16 +44,20 @@ db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) datadir=$(ynh_app_setting_get --app="$app" --key=datadir) +cache_memory_target=$(ynh_app_setting_get --app="$app" --key=cache_memory_target) + 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_web=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended_web) instance_expose_public_timeline=$(ynh_app_setting_get --app="$app" --key=instance_expose_public_timeline) instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes) +instance_inject_mastodon_version=$(ynh_app_setting_get --app="$app" --key=instance_inject_mastodon_version) 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_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css) +accounts_custom_css_length=$(ynh_app_setting_get --app="$app" --key=accounts_custom_css_length) media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) From ec32579fe6659bd186849b61283b3a9dd00d5c25 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 21 Aug 2023 16:02:08 +0000 Subject: [PATCH 10/32] Upgrade to v0.11.1 --- conf/arm64.src | 6 +++--- conf/armv6.src | 6 +++--- conf/armv7.src | 6 +++--- conf/i386.src | 6 +++--- conf/x86-64.src | 6 +++--- manifest.json | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/conf/arm64.src b/conf/arm64.src index bb13f44..6e6a22e 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_arm64.tar.gz -SOURCE_SUM=c0483b53200b7af7bb3d02f2eacd22780deb2ba20ca246bc62198fe18c05f11b +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_arm64.tar.gz +SOURCE_SUM=d5478c5833df4c7a0510b452546640e10575d2fa45fa43dbbc2e2714f762362a SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.11.0_linux_arm64.tar.gz +SOURCE_FILENAME=gotosocial_0.11.1_linux_arm64.tar.gz diff --git a/conf/armv6.src b/conf/armv6.src index f6924d2..b039f2c 100644 --- a/conf/armv6.src +++ b/conf/armv6.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_armv6.tar.gz -SOURCE_SUM=43506e27f7ced4683bd2db665176d3bf6ee761c8a46979af833890862ba74437 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_armv6.tar.gz +SOURCE_SUM=aadd5ecab1d2a42923ca34bdea7791ab5682ef46b36e9b515a57b55217f397bc SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.11.0_linux_armv6.tar.gz +SOURCE_FILENAME=gotosocial_0.11.1_linux_armv6.tar.gz diff --git a/conf/armv7.src b/conf/armv7.src index 8e760cd..9ff86cc 100644 --- a/conf/armv7.src +++ b/conf/armv7.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_armv7.tar.gz -SOURCE_SUM=3950fcf38a0438c33307dc00e91be305a247ff965b592dd54962f359c721a3df +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_armv7.tar.gz +SOURCE_SUM=6c19c23f7476ab0cd5e7e698bfd47bafa582eba84b810dcb8539e97a419cc136 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.11.0_linux_armv7.tar.gz +SOURCE_FILENAME=gotosocial_0.11.1_linux_armv7.tar.gz diff --git a/conf/i386.src b/conf/i386.src index b24a1f8..a9d1351 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.0/gotosocial_0.11.0_linux_386.tar.gz -SOURCE_SUM=1429acce3a61580596816f26c4ce4baf4f299ac47fdd447ad4527ee8103c6a99 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_386.tar.gz +SOURCE_SUM=f66f455c7406ac40ff04320cb8f030b5affe8acd39937a8727b0ea53887c7227 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.11.0_linux_386.tar.gz +SOURCE_FILENAME=gotosocial_0.11.1_linux_386.tar.gz diff --git a/conf/x86-64.src b/conf/x86-64.src index 99c442a..b539f88 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.11.0/gotosocial_0.11.0_linux_amd64.tar.gz -SOURCE_SUM=b008350c7130388860182065d95d23feec6ea10d4c9013528ee96fd041a85804 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_amd64.tar.gz +SOURCE_SUM=4e44a5cb4044a523c51b5d178dfd06efb077a17dac22a9a170d6204cb7aed407 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.11.0_linux_amd64.tar.gz +SOURCE_FILENAME=gotosocial_0.11.1_linux_amd64.tar.gz diff --git a/manifest.json b/manifest.json index ecb993a..e2e8101 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub social network server", "fr": "Serveur de réseau social basé sur ActivityPub" }, - "version": "0.11.0~ynh1", + "version": "0.11.1~ynh1", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", From d02ca7d4ea6576e43cf05aadb1f19a661208afdc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 21 Aug 2023 16:02:14 +0000 Subject: [PATCH 11/32] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b42825..6d13b08 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,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.11.0~ynh1 +**Shipped version:** 0.11.1~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 37a6357..1804a6a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,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.11.0~ynh1 +**Version incluse :** 0.11.1~ynh1 ## Captures d’écran From 6a78cace52c654d6e02620bb65de6e26f0718b1b Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Fri, 25 Aug 2023 16:52:18 +0200 Subject: [PATCH 12/32] add: advanced-csp-extra-uri --- conf/config.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index 08678b2..5cbc7b0 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -903,4 +903,22 @@ advanced-throttling-retry-after: "30s" # 1 cpu = 1 concurrent sender # 2 cpu = 1 concurrent sender # 4 cpu = 1 concurrent sender -advanced-sender-multiplier: 2 \ No newline at end of file +advanced-sender-multiplier: 2 + +# Array of string. Extra URIs to add to 'img-src' and 'media-src' +# when building the Content-Security-Policy header for your instance. +# +# This can be used to allow the browser to load resources from additional +# sources like S3 buckets and so on when viewing your instance's pages +# and profiles in the browser. +# +# Since non-proxying S3 storage will be probed on instance launch to +# generate a correct Content-Security-Policy, you probably won't need +# to ever touch this setting, but it's included in the 'spirit of more +# configurable (usually) means more good'. +# +# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP +# +# Example: ["s3.example.org", "some-bucket-name.s3.example.org"] +# Default: [] +advanced-csp-extra-uris: [] \ No newline at end of file From b6e9ad730725c6591bd4bc18549c3d8be4f98e61 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 28 Aug 2023 17:40:58 +0200 Subject: [PATCH 13/32] markdown linter --- .github/ISSUE_TEMPLATE.md | 7 ++++++- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2729a6b..5258376 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -5,13 +5,15 @@ about: When creating a bug report, please use the following template to provide --- **How to post a meaningful bug report** + 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - *When in doubt, post here and we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* ---- + +--- ### Describe the bug @@ -30,9 +32,11 @@ about: When creating a bug report, please use the following template to provide ### Steps to reproduce - *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh sudo yunohost app install the_app ``` + - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* @@ -47,6 +51,7 @@ about: When creating a bug report, please use the following template to provide ### Logs *When an operation fails, YunoHost provides a simple way to share the logs.* + - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ef70e18..496d9c2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,4 +13,4 @@ ## Automatic tests -Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) +Automatic tests can be triggered on *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) From 524bce27eb564f40161edbe7a4b97682b3b36d76 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 2 Sep 2023 09:05:07 +0200 Subject: [PATCH 14/32] trying to debug restoration on a different CPU architecture --- scripts/restore | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/restore b/scripts/restore index 60848ee..f59d91a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -174,6 +174,31 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --databa ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" --database="$db_name" ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 + +### `ynh_setup_source` is used to install an app from a zip or tar.gz file, +### downloaded from an upstream source, like a git repository. +### `ynh_setup_source` use the file conf/app.src + +# detect_arch comes from _common.sh / personnal helpers +architecture=$(detect_arch) + +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" + +# 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 "$final_path" +chmod -R o-rwx "$final_path" +chown -R "$app:www-data" "$final_path" + #================================================= # RESTORE VARIOUS FILES #================================================= From 8496177feb55cc38c27ab455d0ba5fee03da6e85 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 2 Sep 2023 19:36:15 +0200 Subject: [PATCH 15/32] fix restoration on a different CPU architecture --- scripts/upgrade | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 83bd7e8..7bb2d94 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -338,13 +338,15 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +# detect_arch comes from _common.sh / personnal helpers +architecture="$(detect_arch)" + +# compare is the system arch is different from the binary arch +# if so, download the correct binary +if [ "$architecture" != "$(file "$final_path"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ] +then + ynh_script_progression --message="Migrating binary architecture..." - # detect_arch comes from _common.sh / personnal helpers - architecture=$(detect_arch) - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" fi From 3d6ae25c921aef2d7d9795d2b863b00b90a72e29 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 2 Sep 2023 19:36:44 +0200 Subject: [PATCH 16/32] bump version --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index e2e8101..7fca2a8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub social network server", "fr": "Serveur de réseau social basé sur ActivityPub" }, - "version": "0.11.1~ynh1", + "version": "0.11.1~ynh2", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", @@ -106,4 +106,4 @@ } ] } -} +} \ No newline at end of file From 235488ce201e0aae6fa077bd833b95f5412b6772 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 2 Sep 2023 17:36:49 +0000 Subject: [PATCH 17/32] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d13b08..d8e6dfa 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,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.11.1~ynh1 +**Shipped version:** 0.11.1~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 1804a6a..d0bd5a0 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,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.11.1~ynh1 +**Version incluse :** 0.11.1~ynh2 ## Captures d’écran From 40dc6422a1cd4d1f158c6283ac96982807713444 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 2 Sep 2023 19:41:15 +0200 Subject: [PATCH 18/32] meh, i'm tired --- scripts/restore | 13 ++++++++++--- scripts/upgrade | 12 +++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/restore b/scripts/restore index f59d91a..30c1fe3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -184,10 +184,17 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ### `ynh_setup_source` use the file conf/app.src # detect_arch comes from _common.sh / personnal helpers -architecture=$(detect_arch) +architecture="$(detect_arch)" -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" +# compare is the system arch is different from the binary arch +# if so, download the correct binary +if [ "$architecture" != "$(file "$final_path"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ] +then + ynh_script_progression --message="Migrating binary architecture..." + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" +fi # FIXME: this should be managed by the core in the future # Here, as a packager, you may have to tweak the ownerhsip/permissions diff --git a/scripts/upgrade b/scripts/upgrade index 7bb2d94..83bd7e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -338,15 +338,13 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# detect_arch comes from _common.sh / personnal helpers -architecture="$(detect_arch)" - -# compare is the system arch is different from the binary arch -# if so, download the correct binary -if [ "$architecture" != "$(file "$final_path"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ] +if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Migrating binary architecture..." + 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 ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" fi From 8d030bdd7995b4ed83e76ea5abdc5bf120ecd3ed Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 5 Sep 2023 17:05:06 +0200 Subject: [PATCH 19/32] typo --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 30c1fe3..460ad56 100755 --- a/scripts/restore +++ b/scripts/restore @@ -186,7 +186,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # detect_arch comes from _common.sh / personnal helpers architecture="$(detect_arch)" -# compare is the system arch is different from the binary arch +# compare if the system arch is different from the binary arch # if so, download the correct binary if [ "$architecture" != "$(file "$final_path"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ] then From 29d5e85179e8bddf71f602fdc4c30daf80b6d58f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 22:07:43 +0200 Subject: [PATCH 20/32] initial fail2ban adding --- scripts/backup | 7 +++++++ scripts/install | 7 +++++++ scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 7 +++++++ 5 files changed, 37 insertions(+) diff --git a/scripts/backup b/scripts/backup index 05535cb..14f4599 100755 --- a/scripts/backup +++ b/scripts/backup @@ -72,6 +72,13 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/logrotate.d/$app" +#================================================= +# BACKUP FAIL2BAN CONFIGURATION +#================================================= + +ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index a79e60f..38140cc 100755 --- a/scripts/install +++ b/scripts/install @@ -284,6 +284,13 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate +#================================================= +# SETUP FAIL2BAN +#================================================= + +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/remove b/scripts/remove index 3bd5e14..0298c20 100755 --- a/scripts/remove +++ b/scripts/remove @@ -92,6 +92,14 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate +#================================================= +# REMOVE FAIL2BAN CONFIGURATION +#================================================= + +ynh_script_progression --message="Removing fail2ban configuration..." --weight=1 + +ynh_remove_fail2ban_config + #================================================= # CLOSE A PORT #================================================= diff --git a/scripts/restore b/scripts/restore index 460ad56..9247bf9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -241,6 +241,14 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --we ynh_restore_file --origin_path="/etc/logrotate.d/$app" +#================================================= +# RESTORE THE FAIL2BAN CONFIGURATION +#================================================= + +ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" +ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" +ynh_systemd_action --action=restart --service_name=fail2ban + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 83bd7e8..8e13eee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -410,6 +410,13 @@ ynh_script_progression --message="Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append +#================================================= +# SETUP FAIL2BAN +#================================================= + +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From d1c00c32e16361ab950f036bb74fa8811de4eaca Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 22:37:13 +0200 Subject: [PATCH 21/32] add logpath & regex --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 38140cc..5bf4175 100755 --- a/scripts/install +++ b/scripts/install @@ -289,7 +289,7 @@ ynh_use_logrotate #================================================= # Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" +ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP= .* msg=\"Unauthorized:" --max_retry=5 #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index 8e13eee..be00b13 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -415,7 +415,7 @@ ynh_use_logrotate --non-append #================================================= # Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" +ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP= .* msg=\"Unauthorized:" --max_retry=5 #================================================= # INTEGRATE SERVICE IN YUNOHOST From ed9fc6c961984d394cd0b40b2f76f8aa7cdbdd21 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 22:55:58 +0200 Subject: [PATCH 22/32] add ynh_script_progression for fail2ban --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 5bf4175..6e35f95 100755 --- a/scripts/install +++ b/scripts/install @@ -287,6 +287,7 @@ ynh_use_logrotate #================================================= # SETUP FAIL2BAN #================================================= +ynh_script_progression --message="Configuring fail2ban..." --weight=1 # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP= .* msg=\"Unauthorized:" --max_retry=5 diff --git a/scripts/upgrade b/scripts/upgrade index be00b13..1e54fd0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -413,6 +413,7 @@ ynh_use_logrotate --non-append #================================================= # SETUP FAIL2BAN #================================================= +ynh_script_progression --message="Upgrading fail2ban configuration..." # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP= .* msg=\"Unauthorized:" --max_retry=5 From eed0be846cbf7c0c45e033ccd644e619a5a4d8f9 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 23:06:40 +0200 Subject: [PATCH 23/32] bump version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 7fca2a8..4c5860e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub social network server", "fr": "Serveur de réseau social basé sur ActivityPub" }, - "version": "0.11.1~ynh2", + "version": "0.11.1~ynh3", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", From 736d548f1a4b2887bb374857e0e65ae8017c2c23 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 Sep 2023 21:06:45 +0000 Subject: [PATCH 24/32] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d8e6dfa..5a97609 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,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.11.1~ynh2 +**Shipped version:** 0.11.1~ynh3 ## Screenshots diff --git a/README_fr.md b/README_fr.md index d0bd5a0..695a233 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,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.11.1~ynh2 +**Version incluse :** 0.11.1~ynh3 ## Captures d’écran From 84e8921a18881a3b20a6aec919c65356d8209be4 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 23:16:52 +0200 Subject: [PATCH 25/32] Create the logfile, required before configuring fail2ban --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 6e35f95..12c3195 100755 --- a/scripts/install +++ b/scripts/install @@ -289,6 +289,9 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Configuring fail2ban..." --weight=1 +# Create the logfile, required before configuring fail2ban +touch "/var/log/${app}/${app}.log" + # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP= .* msg=\"Unauthorized:" --max_retry=5 From 90927e2da1fa44927907ba54986685fc30f96758 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 10 Sep 2023 23:25:05 +0200 Subject: [PATCH 26/32] mask the `"remote_url" has [count(*)] args, but no placeholders` error --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 12c3195..f7fe5e6 100755 --- a/scripts/install +++ b/scripts/install @@ -307,9 +307,9 @@ yunohost service add "$app" --description="Gotosocial server" --log="/var/log/$a #================================================= ynh_script_progression --message="Creating gotosocial admin user..." --weight=1 -"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" +ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" -"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" +ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" #================================================= # START SYSTEMD SERVICE From cc96fc480487a1005be254915438832d3c74aca7 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Sep 2023 00:30:07 +0200 Subject: [PATCH 27/32] meh linter --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f7fe5e6..12c3195 100755 --- a/scripts/install +++ b/scripts/install @@ -307,9 +307,9 @@ yunohost service add "$app" --description="Gotosocial server" --log="/var/log/$a #================================================= ynh_script_progression --message="Creating gotosocial admin user..." --weight=1 -ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" +"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" -ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" +"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" #================================================= # START SYSTEMD SERVICE From 15fe5958c20a5de53e5ef7e81527f36612fdaca5 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Sep 2023 00:31:50 +0200 Subject: [PATCH 28/32] mask the `"remote_url" has [count(*)] args, but no placeholders` error --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 12c3195..f7fe5e6 100755 --- a/scripts/install +++ b/scripts/install @@ -307,9 +307,9 @@ yunohost service add "$app" --description="Gotosocial server" --log="/var/log/$a #================================================= ynh_script_progression --message="Creating gotosocial admin user..." --weight=1 -"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" +ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password" -"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" +ynh_exec_warn_less "$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account promote --username "$admin" #================================================= # START SYSTEMD SERVICE From 803b66060630cad699f04744ce9017ca7a388e58 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Sep 2023 17:39:20 +0200 Subject: [PATCH 29/32] implementing media caching --- conf/nginx.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 1a4cd60..c1a87f0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,3 +13,31 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + + +# media caching stuff +# https://docs.gotosocial.org/en/latest/advanced/caching/assets-media/#nginx + +location /assets/ { + alias web-asset-base-dir/; + autoindex off; + expires 5m; + add_header Cache-Control "public"; +} + +location @fileserver { + proxy_pass http://localhost:__PORT__; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; +} + +location /fileserver/ { + alias storage-local-base-path/; + autoindex off; + expires 1w; + add_header Cache-Control "private, immutable"; + try_files $uri @fileserver; +} \ No newline at end of file From d436324ae33ccb8e5463cc47ada69a1ea7d80f52 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Sep 2023 19:18:27 +0200 Subject: [PATCH 30/32] finalizing nginx media caching conf & various fixes --- conf/nginx.conf | 66 +++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c1a87f0..7bf49a7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,43 +1,45 @@ location __PATH__/ { proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - - proxy_pass http://localhost:__PORT__; - - client_max_body_size __CLIENT_MAX_BODY_SIZE__; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; -} - - -# media caching stuff -# https://docs.gotosocial.org/en/latest/advanced/caching/assets-media/#nginx - -location /assets/ { - alias web-asset-base-dir/; - autoindex off; - expires 5m; - add_header Cache-Control "public"; -} - -location @fileserver { - proxy_pass http://localhost:__PORT__; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_pass http://127.0.0.1:__PORT__; + + client_max_body_size __CLIENT_MAX_BODY_SIZE__; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; + + + # media caching stuff + # https://docs.gotosocial.org/en/latest/advanced/caching/assets-media/#nginx + location /assets/ { + alias __FINAL_PATH__/web/assets/; + autoindex off; + expires 5m; + add_header Cache-Control "public"; + } + + location /fileserver/ { + alias __DATADIR__; + autoindex off; + expires 1w; + add_header Cache-Control "private, immutable"; + try_files $uri @fileserver; + } + } -location /fileserver/ { - alias storage-local-base-path/; - autoindex off; - expires 1w; - add_header Cache-Control "private, immutable"; - try_files $uri @fileserver; +location @fileserver { + proxy_pass http://127.0.0.1:__PORT__; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; } \ No newline at end of file From f3ef8588cca9819598ad877c6efae13fffe1810e Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Sep 2023 19:27:33 +0200 Subject: [PATCH 31/32] bump version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 4c5860e..2bd1d0b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "ActivityPub social network server", "fr": "Serveur de réseau social basé sur ActivityPub" }, - "version": "0.11.1~ynh3", + "version": "0.11.1~ynh4", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", From 1d706e3902a84f34f2c21f34b193e7d3a17b05a8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 11 Sep 2023 17:27:37 +0000 Subject: [PATCH 32/32] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a97609..9bc5506 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,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.11.1~ynh3 +**Shipped version:** 0.11.1~ynh4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 695a233..c26fcd4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,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.11.1~ynh3 +**Version incluse :** 0.11.1~ynh4 ## Captures d’écran