diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index e050b69..27e5ebc 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -119,9 +119,6 @@ done # GENERIC FINALIZATION #================================================= -# Install moreutils, needed for sponge -sudo apt-get install moreutils - # Replace new version in manifest jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json | sponge manifest.json diff --git a/conf/app.src b/conf/app.src index 646e432..347b4e5 100755 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=a35f8a4cb25f1f75e49ec40dcc9b1cd7ef4fb099322507464272be720fdc28d3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/scripts/backup b/scripts/backup index d548f15..09a69f4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -47,7 +47,11 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# SPECIFIC BACKUP +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index 52b3af8..35b3a40 100755 --- a/scripts/install +++ b/scripts/install @@ -112,6 +112,14 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ ynh_add_systemd_config +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= diff --git a/scripts/remove b/scripts/remove index 96d9de7..24187d6 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,6 +41,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index 3840f34..d0f22ab 100755 --- a/scripts/restore +++ b/scripts/restore @@ -84,6 +84,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4a6bd02..532ec7f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,6 +119,14 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ ynh_add_systemd_config +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #=================================================