From 1375738bf5347fa34de2c55047b28169c981e82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 31 Aug 2024 09:10:56 +0200 Subject: [PATCH] cleaning --- manifest.toml | 10 +++++----- scripts/backup | 9 --------- scripts/change_url | 3 --- scripts/install | 6 ------ scripts/remove | 4 ---- scripts/restore | 3 --- scripts/upgrade | 35 ++++++----------------------------- 7 files changed, 11 insertions(+), 59 deletions(-) diff --git a/manifest.toml b/manifest.toml index 14d1406..1ef0043 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Tiny Tiny RSS" description.en = "News feed (RSS/Atom) reader and aggregator" description.fr = "Lecteur de flux d’actualité utilisant les protocoles RSS et Atom" -version = "20231202~ynh3" +version = "20240831~ynh1" maintainers = [] @@ -17,7 +17,7 @@ admindoc = "https://tt-rss.org/wiki.php" code = "https://gitlab.tt-rss.org/tt-rss/tt-rss" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true @@ -44,8 +44,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://gitlab.tt-rss.org/tt-rss/tt-rss/-/archive/2b8e34453234b8b31ebc9e7020f8677bf3889898.tar.gz" - sha256 = "72ec560bd5ad7bac4789d7af0e5c2d7c1c394e9c540d46d5421ecae219d8f875" + url = "https://gitlab.tt-rss.org/tt-rss/tt-rss/-/archive/d5d47b8e500542fc4b6f89ef11bef3ceae833063.tar.gz" + sha256 = "72e13a9e1b568055c9c6d072d8ec5b87d670af59e63f6202cfad1fe333b15866" autoupdate.strategy = "latest_gitlab_commit" [resources.system_user] @@ -69,7 +69,7 @@ ram.runtime = "50M" api.allowed = "visitors" [resources.apt] - packages = "postgresql, php8.2-pgsql, php8.2-curl, php8.2-gd, php8.2-opcache, php8.2-fileinfo, php8.2-intl, php8.2-cli, php8.2-mbstring, php8.2-xml" + packages = "postgresql, php8.3-pgsql, php8.3-curl, php8.3-gd, php8.3-opcache, php8.3-fileinfo, php8.3-intl, php8.3-cli, php8.3-mbstring, php8.3-xml" [resources.database] type = "postgresql" diff --git a/scripts/backup b/scripts/backup index bc1d90d..1341228 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -18,16 +17,8 @@ ynh_backup "$install_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/change_url b/scripts/change_url index 374330b..3ec62ee 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,9 +28,6 @@ domain="$new_domain" path="$new_path" ynh_config_add --template="config.php" --destination="$install_dir/config.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app "$install_dir/config.php" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/install b/scripts/install index 0a03bbb..7fcf8cf 100644 --- a/scripts/install +++ b/scripts/install @@ -10,12 +10,9 @@ ynh_app_setting_set --key=php_upload_max_filesize --value=10M #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= @@ -41,9 +38,6 @@ ynh_script_progression "Adding $app's configuration..." ynh_config_add --template="config.php" --destination="$install_dir/config.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app "$install_dir/config.php" - #================================================= # INITIALIZE DATABASE #================================================= diff --git a/scripts/remove b/scripts/remove index 464011a..8960c7f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -11,20 +11,16 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Removing system configurations related to $app..." -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null then ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config ynh_config_remove_phpfpm #================================================= diff --git a/scripts/restore b/scripts/restore index 8eddf7b..2c5f475 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -11,8 +10,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f93cc2d..ea806b4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,38 +17,25 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression "Ensuring downward compatibility..." -# Do not remove the file before the backup, to not fail the backup. -# Remove old cron job ynh_safe_rm "/etc/cron.d/$app" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." +ynh_setup_source --dest_dir="$install_dir" +echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" - echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt" -fi - -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated PHP-FPM config ynh_config_add_phpfpm -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log" @@ -56,21 +43,11 @@ yunohost service add $app --description="News feed reader and aggregator" --log= #================================================= # UPDATE A CONFIG FILE #================================================= +ynh_script_progression "Updating configuration..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Updating configuration..." +ynh_config_add --template="config.php" --destination="$install_dir/config.php" - ynh_config_add --template="config.php" --destination="$install_dir/config.php" - - ynh_script_progression "Upgrading the database..." - - ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes -fi - -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.php" +ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes #================================================= # START SYSTEMD SERVICE