diff --git a/conf/weblate.service b/conf/weblate.service index e9a947d..9b3d597 100644 --- a/conf/weblate.service +++ b/conf/weblate.service @@ -30,4 +30,4 @@ StandardError=syslog NotifyAccess=all [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/scripts/_common.sh b/scripts/_common.sh index 805b9c1..c8f2733 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,6 +7,7 @@ # dependencies used by the app pkg_dependencies="libxml2-dev libxslt-dev libfreetype6-dev \ libjpeg-dev libz-dev libyaml-dev python3-dev python3-pip python3-virtualenv \ + python3-enchant \ postgresql libpq-dev uwsgi uwsgi-plugin-python3 \ libpango1.0-dev libcairo2-dev libglib2.0-dev libgirepository1.0-dev \ mailutils python-celery-common virtualenv redis-server" diff --git a/scripts/backup b/scripts/backup index e357c7f..3f407e7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -61,6 +61,13 @@ ynh_backup "db.sql" #================================================= # SPECIFIC BACKUP +#================================================= +# BACKUP LOGROTATE +#================================================= +ynh_script_progression --message="Backing up logrotate configuration..." --time --weight=1 + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP THE CRON FILE #================================================= diff --git a/scripts/install b/scripts/install index 820e5c1..402c2f4 100755 --- a/scripts/install +++ b/scripts/install @@ -300,6 +300,14 @@ chown -R "$app": "$final_path/data" mkdir -p "$final_path/avatar-cache" chown -R "$app": "$final_path/avatar-cache" +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --time --weight=1 + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate --logfile "/var/log/$app-celery" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index 16be183..87adac0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -79,6 +79,14 @@ ynh_script_progression --message="Removing nginx web server configuration..." -- # Remove the dedicated nginx config ynh_remove_nginx_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index ddbf231..fe52137 100755 --- a/scripts/restore +++ b/scripts/restore @@ -123,6 +123,12 @@ ynh_restore_file "/etc/cron.d/$app" ynh_script_progression --message="Restore hub's binary file..." --time --weight=1 ynh_restore_file "/usr/bin/hub" +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 55dad7b..c5a9e9e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -397,6 +397,14 @@ cp ../conf/cron "/etc/cron.d/$app" ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app" ynh_replace_string "__FINALPATH__" "$final_path/" "/etc/cron.d/$app" +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1 + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --logfile "/var/log/$app-celery" --non-append + #================================================= # GENERIC FINALIZATION #=================================================