diff --git a/manifest.json b/manifest.json index ff69a25..92d1d7b 100644 --- a/manifest.json +++ b/manifest.json @@ -22,7 +22,7 @@ "url": "https://frju365.yunohost.support" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.2" }, "multi_instance": false, "services": [ diff --git a/scripts/backup b/scripts/backup index c6c42c3..940d3b5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -46,7 +46,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 23c4c4d..4f764f7 100644 --- a/scripts/install +++ b/scripts/install @@ -131,6 +131,14 @@ pushd "$final_path" ynh_exec_warn_less bower install --allow-root popd +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index ad1593c..fa4e5c4 100644 --- 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" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0cafe05..02f695c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,6 +139,14 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ # Create a dedicated systemd config 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 + #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================