From 020dd4abfe6dad2eea3c0fb47b45d4a1b17d3714 Mon Sep 17 00:00:00 2001 From: Chris Vogel Date: Thu, 25 Apr 2024 10:43:20 +0200 Subject: [PATCH] avoid linter message `! Using helper ynh_backup_before_upgrade is deprecated when using packaging v2 ... It is replaced by: nothing, handled by the core, just get rid of it` I only use `ynh_backup_before_upgrade` in a comment. Try to cloak it by inserting some invisible space. Removed debugging outpug from scripts/restore (after backing it up to branch debugging_restore. --- scripts/backup | 3 ++- scripts/restore | 20 -------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/scripts/backup b/scripts/backup index 9096902..afe4b97 100755 --- a/scripts/backup +++ b/scripts/backup @@ -19,10 +19,11 @@ ynh_print_info --message="Stopping flohmarkt and couchdb to backup data..." yunohost service stop flohmarkt systemctl stop couchdb +# https://codeberg.org/ChriChri/flohmarkt_ynh/issues/24 # since this might be re-installed as a dependency during 'remove' and # 'install' anew (like after a failed upgrade) we do not want to use # --is_big even thought the directories might be big because: -# "don't want that your package does backup that part during ynh_backup_before_upgrade" +# "don't want that your package does backup that part during ynh_backup_before_upgrade" # https://yunohost.org/en/packaging_apps_scripts_helpers#ynh-backup # # if this becomes a pain we'll need to stop deleting this directories on 'remove' diff --git a/scripts/restore b/scripts/restore index 25c25be..914f0ff 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,12 +76,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" -# add some debugging to find #21 -ls -lR /var/lib/couchdb /opt/couchdb/etc $install_dir /var/log/couchdb/couchdb.log \ - /var/log/$app/$app.log $data_dir /etc/nginx/conf.d/$domain.d/$app.conf || true -cat $install_dir/$app/flohmarkt.conf /opt/couchdb/etc/local.d/05-flohmarkt.ini -tail -n50 /var/log/couchdb/couchdb.log /var/log/$app/$app.log || true - # restore flohmarkt systemd service and integrate service into yunohost ynh_script_progression --message="Restoring flohmarkt.service and integrating service into YunoHost..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" @@ -89,22 +83,8 @@ ynh_systemd_action --action=enable yunohost service add $app --description="A decentral federated small advertisement platform" --log="/var/log/$app/$app.log" ynh_systemd_action --action=start --line_match="INFO: Application startup complete." -# add some debugging to find #21 -systemctl status flohmarkt -systemctl status couchdb - # RELOAD NGINX ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload -# add some debugging to find #21 -ps axuf -netstat -pnlt -cat /etc/nginx/conf.d/$domain.d/$app.conf -curl -D - "http://admin:$password_couchdb_admin@127.0.0.1:5984" || true -curl -D - "http://flohmarkt:$password_couchdb_flohmarkt@127.0.0.1:5984" || true -curl -D - "http://127.0.0.1:8000" || true -curl -D - "http://$domain" || true -curl -kD - "https://$domain" || true - ynh_script_progression --message="Restoration completed for $app" --last