From 49e00dd2dd18b0a833455e7ebcd9f4f2ca372531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:45:43 +0200 Subject: [PATCH] cleaning --- scripts/remove | 4 ---- scripts/restore | 5 +---- scripts/upgrade | 12 +++--------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/scripts/remove b/scripts/remove index 66de3a0..6a7ee5f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -8,18 +8,14 @@ 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 yunohost service remove $app fi -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the app-specific logrotate config ynh_config_remove_logrotate _remove_restart_script_and_sudoers diff --git a/scripts/restore b/scripts/restore index c3efd21..9d373da 100755 --- 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 @@ -20,14 +19,11 @@ if [ -n "$public_key" ]; then _install_restart_script_and_sudoers fi -#================================================= -# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_script_progression "Reinstalling NodeJS..." -# Define and install dependencies ynh_nodejs_install #================================================= @@ -43,6 +39,7 @@ mkdir --parents /var/log/$app ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet + yunohost service add $app --description="A Cors proxy letting the browser manages cookies and redirects." --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 24c67d0..eeceb1b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,13 +35,9 @@ ynh_nodejs_install #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# 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_script_progression "Upgrading source files..." - # Download, check integrity, uncompress and patch the source from amd64.src - ynh_setup_source --dest_dir="$install_dir/package" --full_replace -fi +ynh_setup_source --dest_dir="$install_dir/package" --full_replace if [ -n "$public_key" ]; then ynh_script_progression "Enabling ssh access for dev..." @@ -84,14 +80,12 @@ _generate_env_file #================================================= ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd + yunohost service add $app --description="A Cors proxy letting the browser manages cookies and redirects." --log="/var/log/$app/$app.log" -# Use logrotate to manage app-specific logfile(s) ynh_config_add_logrotate #=================================================