From 5162591244118d927fe6607fee901da97be75a73 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Apr 2022 14:01:27 +0200 Subject: [PATCH] Fix --- .github/workflows/updater.sh | 5 +---- scripts/backup | 6 ++++++ scripts/change_url | 2 +- scripts/install | 10 +++++++++- scripts/restore | 9 ++++++++- scripts/upgrade | 8 ++++++++ 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 7ce2f3c..6274d07 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -63,7 +63,7 @@ echo "Handling asset at $asset_url" # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) # Leave $src empty to ignore the asset case $asset_url in - *".tar.gz"*) + *".tar.gz") src="app" ;; esac @@ -117,9 +117,6 @@ done # GENERIC FINALIZATION #================================================= -# Install moreutils, needed for sponge -sudo apt-get install moreutils - # Replace new version in manifest echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json diff --git a/scripts/backup b/scripts/backup index c6c42c3..6d6d631 100644 --- a/scripts/backup +++ b/scripts/backup @@ -45,6 +45,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" + #================================================= # SPECIFIC BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index 4dff8ab..c292b89 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -107,7 +107,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server available" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Serving content" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 6dbebbe..eaa37bb 100644 --- a/scripts/install +++ b/scripts/install @@ -130,6 +130,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 #================================================= @@ -143,7 +151,7 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="server available" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Serving content" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index ad1593c..25fabf5 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 #================================================= @@ -96,7 +103,7 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server available" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Serving content" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index ec81c07..1a70a51 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,14 @@ env_path="$PATH" # 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 #=================================================