From 8d27dd88c49efc56bf983df313dc42af26c63a77 Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Wed, 28 Aug 2024 17:23:20 +0200 Subject: Remove custom swap helpers ; use new upstream helpers --- manifest.toml | 3 +- scripts/install | 1 - scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 1 - scripts/ynh_add_swap | 100 --------------------------------------------------- 6 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 scripts/ynh_add_swap diff --git a/manifest.toml b/manifest.toml index 318d01d..84e7098 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,7 +19,8 @@ cpe = "cpe:2.3:a:joinmastodon:mastodon" fund = "https://joinmastodon.org/sponsors" [integration] -yunohost = ">= 11.2.12" +yunohost = ">=11.2.30" +helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/install b/scripts/install index 1385a30..1890e51 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_add_swap source /usr/share/yunohost/helpers admin_mail=$(ynh_user_get_info --username=$admin --key=mail) diff --git a/scripts/remove b/scripts/remove index c8ca3a3..f5eca20 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_add_swap source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 77e934b..92a20f0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,6 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source ../settings/scripts/ynh_add_swap source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c889e65..0bac752 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_add_swap source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) diff --git a/scripts/ynh_add_swap b/scripts/ynh_add_swap deleted file mode 100644 index aa82c51..0000000 --- a/scripts/ynh_add_swap +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash - -# Add swap -# -# usage: ynh_add_swap --size=SWAP in Mb -# | arg: -s, --size= - Amount of SWAP to add in Mb. -ynh_add_swap () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [s]=size= ) - local size - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - local swap_max_size=$(( $size * 1024 )) - - local free_space=$(df --output=avail / | sed 1d) - # Because we don't want to fill the disk with a swap file, divide by 2 the available space. - local usable_space=$(( $free_space / 2 )) - - SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0} - - # Can't swap inside an LXD - if [ "$(systemd-detect-virt)" == "lxc" ] - then - ynh_print_warn --message="You are inside a LXC container, swap will not be added, but that can cause troubles for the app $app. Please make sure you have more than 2.5G available RAM." - return - fi - - # Swap on SD card only if it's is specified - if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ] - then - ynh_print_warn --message="The main mountpoint of your system '/' is on an SD card, swap will not be added to prevent some damage of this one, but that can cause troubles for the app $app. If you still want activate the swap, you can relaunch the command preceded by 'SD_CARD_CAN_SWAP=1'" - return - fi - - # Compare the available space with the size of the swap. - # And set a acceptable size from the request - if [ $usable_space -ge $swap_max_size ] - then - local swap_size=$swap_max_size - elif [ $usable_space -ge $(( $swap_max_size / 2 )) ] - then - local swap_size=$(( $swap_max_size / 2 )) - elif [ $usable_space -ge $(( $swap_max_size / 3 )) ] - then - local swap_size=$(( $swap_max_size / 3 )) - elif [ $usable_space -ge $(( $swap_max_size / 4 )) ] - then - local swap_size=$(( $swap_max_size / 4 )) - else - echo "Not enough space left for a swap file" >&2 - local swap_size=0 - fi - - # If there's enough space for a swap, and no existing swap here - if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ] - then - # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case - if ! fallocate -l ${swap_size}K /swap_$app - then - dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size} - fi - chmod 0600 /swap_$app - # Create the swap - mkswap /swap_$app - # And activate it - swapon /swap_$app - # Then add an entry in fstab to load this swap at each boot. - echo -e "/swap_$app swap swap defaults 0 0 #Swap added by $app" >> /etc/fstab - fi -} - -ynh_del_swap () { - # If there a swap at this place - if [ -e /swap_$app ] - then - # Clean the fstab - sed -i "/#Swap added by $app/d" /etc/fstab - # Desactive the swap file - swapoff /swap_$app - # And remove it - rm /swap_$app - fi -} - -# Check if the device of the main mountpoint "/" is an SD card -# -# [internal] -# -# return 0 if it's an SD card, else 1 -ynh_is_main_device_a_sd_card () { - local main_device=$(lsblk --output PKNAME --noheadings $(findmnt / --nofsroot --uniq --output source --noheadings --first-only)) - - if echo $main_device | grep --quiet "mmc" && [ $(tail -n1 /sys/block/$main_device/queue/rotational) == "0" ] - then - return 0 - else - return 1 - fi -} -- cgit v1.2.3-70-g09d2 From 4976431397f6e9824526276bdd94d62cefb3548a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 30 Aug 2025 14:41:25 +0200 Subject: ruby and nodejs resources --- manifest.toml | 9 ++++++++- scripts/_common.sh | 2 -- scripts/install | 8 -------- scripts/remove | 4 ---- scripts/restore | 8 -------- scripts/upgrade | 8 -------- 6 files changed, 8 insertions(+), 31 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7f0b634..152433a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,7 +19,7 @@ cpe = "cpe:2.3:a:joinmastodon:mastodon" fund = "https://joinmastodon.org/sponsors" [integration] -yunohost = ">= 12.0.10" +yunohost = ">= 12.1.15" helpers_version = "2.1" architectures = "all" multi_instance = true @@ -87,3 +87,10 @@ ram.runtime = "500M" [resources.database] type = "postgresql" + + [resources.nodejs] + version = "20" + + [resources.ruby] + version = "3.4.5" + diff --git a/scripts/_common.sh b/scripts/_common.sh index 182e391..c7ff983 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,6 @@ #================================================= memory_needed="2560" -ruby_version=3.4.5 -nodejs_version=20 case $YNH_ARCH in amd64) diff --git a/scripts/install b/scripts/install index 7e400d5..38395c5 100644 --- a/scripts/install +++ b/scripts/install @@ -8,14 +8,6 @@ admin_mail=$(ynh_user_get_info --username=$admin --key=mail) # Set `service` settings to support `yunohost app shell` command ynh_app_setting_set --key=service --value="$app-web.service" -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression "Installing Ruby and NodeJS..." - -ynh_ruby_install -ynh_nodejs_install - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/remove b/scripts/remove index 297786f..e97be10 100644 --- a/scripts/remove +++ b/scripts/remove @@ -44,10 +44,6 @@ ynh_safe_rm "/etc/cron.d/$app" # Remote logrotate config ynh_config_remove_logrotate -# Remove metapackage and its dependencies -ynh_ruby_remove -ynh_nodejs_remove - # Remove swap ynh_del_swap diff --git a/scripts/restore b/scripts/restore index 0becd6c..2abaa4d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,14 +39,6 @@ ynh_script_progression "Adding $swap_needed Mo to swap..." ynh_add_swap --size=$swap_needed -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression "Reinstalling Ruby and NodeJS..." - -ynh_ruby_install -ynh_nodejs_install - #================================================= # BUILD APP #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 769b47c..1d28afd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,14 +46,6 @@ fi ynh_script_progression "Adding $swap_needed Mo to swap..." ynh_add_swap --size=$swap_needed -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression "Upgrading Ruby and NodeJS..." - -ynh_ruby_install -ynh_nodejs_install - #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= -- cgit v1.2.3-70-g09d2 From 8924efedabefe76a7c4f327952a0e850611da8ee Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 1 Sep 2025 11:34:17 +0200 Subject: cleaning --- manifest.toml | 3 ++- scripts/install | 4 ---- scripts/upgrade | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/manifest.toml b/manifest.toml index 3575af5..7fc0329 100644 --- a/manifest.toml +++ b/manifest.toml @@ -67,7 +67,8 @@ ram.runtime = "500M" allow_email = true [resources.install_dir] - + group = "www-data:r-x" + [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index 7e400d5..315cca6 100644 --- a/scripts/install +++ b/scripts/install @@ -25,10 +25,6 @@ ynh_setup_source --dest_dir="$install_dir/live" # Download redis migration script ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live" -chmod -R 775 "$install_dir" -chmod o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # ADD SWAP IF NEEDED #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3b8f6e8..735ecc2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,10 +64,6 @@ ynh_setup_source --dest_dir="$install_dir/live" --full_replace --keep="public/sy # Download redis migration script ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live" -chmod -R 775 "$install_dir" -chmod o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # BUILD ASSETS #================================================= -- cgit v1.2.3-70-g09d2 From be2718c43687ff875fd7696cde4b98681c17d0eb Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 1 Sep 2025 12:00:09 +0200 Subject: Update manifest.toml --- manifest.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 066569a..bdb7071 100644 --- a/manifest.toml +++ b/manifest.toml @@ -88,8 +88,7 @@ ram.runtime = "500M" type = "postgresql" [resources.nodejs] - version = "20" + version = "22" [resources.ruby] version = "3.4.5" - -- cgit v1.2.3-70-g09d2 From 24b842a772def1cf183da68c0e8de2f59c2206f4 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:12:22 +0200 Subject: cleaning --- scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index fad9eb9..ddb0692 100644 --- a/scripts/install +++ b/scripts/install @@ -25,6 +25,10 @@ ynh_setup_source --dest_dir="$install_dir/live" # Download redis migration script ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live" +chmod -R 775 "$install_dir" +chmod o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # ADD SWAP IF NEEDED #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ce24e0d..9b3c8db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,6 +64,10 @@ ynh_setup_source --dest_dir="$install_dir/live" --full_replace --keep="public/sy # Download redis migration script ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live" +chmod -R 775 "$install_dir" +chmod o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # BUILD ASSETS #================================================= -- cgit v1.2.3-70-g09d2 From d8854f4e663f6a24771bb2d1e1f78c8ff09ccfc1 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 17 Sep 2025 21:33:12 +0200 Subject: Update _common.sh --- scripts/_common.sh | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c7ff983..0ad6190 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,21 +5,3 @@ #================================================= memory_needed="2560" - -case $YNH_ARCH in - amd64) - ld_preload="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so" - ;; - arm64) - ld_preload="LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so" - ;; - armhf) - ld_preload="LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libjemalloc.so" - ;; - armel) - ld_preload="LD_PRELOAD=/usr/lib/arm-linux-gnueabi/libjemalloc.so" - ;; - i386) - ld_preload="LD_PRELOAD=/usr/lib/i386-linux-gnu/libjemalloc.so" - ;; -esac -- cgit v1.2.3-70-g09d2 From e95f8793985aa958fcc909acedf075e73a0f9a48 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 24 Sep 2025 00:20:55 +0200 Subject: Upgrade sources - `main` v4.4.5: https://github.com/mastodon/mastodon/releases/tag/v4.4.5 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index f85d5c0..03fe662 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Mastodon" description.en = "Libre and federated social network" description.fr = "Réseau social libre et fédéré" -version = "4.4.4~ynh1" +version = "4.4.5~ynh1" maintainers = [] @@ -52,8 +52,8 @@ ram.runtime = "500M" [resources] [resources.sources] [resources.sources.main] - url = "https://github.com/mastodon/mastodon/archive/refs/tags/v4.4.4.tar.gz" - sha256 = "1df58eec7da0c47767493ec3ec3ec2225a0bcca94871d1d6615ee324aaed91ba" + url = "https://github.com/mastodon/mastodon/archive/refs/tags/v4.4.5.tar.gz" + sha256 = "add9ee5caae722549a2f7ed2129ecaed0945a1b2f942afbdbb7bd8ab73961fe6" autoupdate.strategy = "latest_github_release" [resources.sources.redis_migration] -- cgit v1.2.3-70-g09d2 From 059bfc00baaf5bc97b2bf0310c6401f2fd85f096 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 24 Sep 2025 00:20:56 +0200 Subject: Auto-update READMEs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 699db55..eab8681 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Libre and federated social network [![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://joinmastodon.org/) [![App Demo](https://img.shields.io/badge/App_Demo-blue?style=for-the-badge)](https://joinmastodon.org/) -[![Version: 4.4.4~ynh1](https://img.shields.io/badge/Version-4.4.4~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/mastodon/) +[![Version: 4.4.5~ynh1](https://img.shields.io/badge/Version-4.4.5~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
-- cgit v1.2.3-70-g09d2 From 896d84f7a77d9b6883ef35ec34f20b3784341115 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 24 Sep 2025 22:58:49 +0200 Subject: Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 588a0db..1054cdb 100644 --- a/tests.toml +++ b/tests.toml @@ -22,4 +22,4 @@ test_format = 1.0 # ------------------------------- #test_upgrade_from.8102fffa52a4e3279bba9fbdafb3a0e5b1fe3e17.name = "4.2.13~ynh1" - test_upgrade_from.38e8436dd8489140af8921c81d9d891bfa92349e.name = "4.3.9 - Helpers v1" + #test_upgrade_from.38e8436dd8489140af8921c81d9d891bfa92349e.name = "4.3.9 - Helpers v1" -- cgit v1.2.3-70-g09d2 From ca0f40885c7c8178161672bd369040dbc52208f5 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:00:38 +0200 Subject: cleaning --- conf/nginx.conf | 3 --- scripts/backup | 2 -- 2 files changed, 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 09e4a84..287d1d7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,9 +6,6 @@ location / { proxy_set_header Accept-Encoding ""; try_files $uri @proxy; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; } location ~ /sw.js { diff --git a/scripts/backup b/scripts/backup index e9b18e8..5172032 100644 --- a/scripts/backup +++ b/scripts/backup @@ -18,8 +18,6 @@ ynh_backup "$install_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= -- cgit v1.2.3-70-g09d2 From f96b0e723def8d1c4b67ec9559b518b8e54df872 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Thu, 25 Sep 2025 03:18:17 +0200 Subject: Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 1054cdb..954023a 100644 --- a/tests.toml +++ b/tests.toml @@ -21,5 +21,5 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - #test_upgrade_from.8102fffa52a4e3279bba9fbdafb3a0e5b1fe3e17.name = "4.2.13~ynh1" #test_upgrade_from.38e8436dd8489140af8921c81d9d891bfa92349e.name = "4.3.9 - Helpers v1" + test_upgrade_from.c2e28fb47626fca1b6fbd00796a94f5f290435d2.name = "4.4.4~ynh1" \ No newline at end of file -- cgit v1.2.3-70-g09d2