From 988e7180c5e3cdbeec78eb2c176f453dfad1438e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 13 Dec 2021 17:07:26 +0100 Subject: [PATCH] Fix --- manifest.json | 3 +-- scripts/backup | 6 ++++++ scripts/install | 9 +++++++++ scripts/remove | 8 ++++++++ scripts/restore | 7 +++++++ scripts/upgrade | 1 + 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 721c1cc..2e95c53 100644 --- a/manifest.json +++ b/manifest.json @@ -28,8 +28,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "is_public", diff --git a/scripts/backup b/scripts/backup index 3c0e9fa..d104a02 100644 --- a/scripts/backup +++ b/scripts/backup @@ -43,6 +43,12 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index e39fc81..dd87b79 100644 --- a/scripts/install +++ b/scripts/install @@ -119,6 +119,7 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less yarn install + ynh_exec_warn_less yarn build popd chown -R $app: $final_path @@ -149,6 +150,14 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions to app files chown -R $app: $final_path +#================================================= +# 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/remove b/scripts/remove index ed9f121..09d8112 100644 --- 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..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index 5f3af55..7ca0d3b 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 945183c..30efdf9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,6 +122,7 @@ then pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less yarn install + ynh_exec_warn_less yarn build popd fi