From af41ce6be41cd56794575f602a1587dbf9614471 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 7 Jan 2022 04:00:37 +0100 Subject: [PATCH 1/3] Few improvements --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/remove | 16 ++++++++-------- scripts/restore | 19 ++++++++++--------- scripts/upgrade | 26 +++++++++++++------------- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index edc54d1..8dca7d6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -90,7 +90,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config "port" + ynh_add_nginx_config fi # Change the domain for NGINX diff --git a/scripts/install b/scripts/install index e01cd6b..b9d2ba9 100644 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/remove b/scripts/remove index 43e1f46..8e9e32f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -42,12 +42,12 @@ ynh_script_progression --message="Stopping and removing the systemd service..." ynh_remove_systemd_config #================================================= -# REMOVE DEPENDENCIES +# REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing dependencies..." +ynh_script_progression --message="Removing logrotate configuration..." -# Remove metapackage and its dependencies -ynh_remove_app_dependencies +# Remove the app-specific logrotate config +ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR @@ -66,12 +66,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." ynh_remove_nginx_config #================================================= -# REMOVE LOGROTATE CONFIGURATION +# REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing dependencies..." -# Remove the app-specific logrotate config -ynh_remove_logrotate +# Remove metapackage and its dependencies +ynh_remove_app_dependencies #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index fd1df9c..863b1f8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,7 +36,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -53,7 +54,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # RESTORE THE APP MAIN DIR @@ -89,6 +90,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." 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..." + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -103,13 +111,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on port" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 860b939..23e15bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,18 +28,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -63,13 +51,25 @@ ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped $app search index daemon" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 8e1d0c0ccdaba6148492c294cde4f1d71225c5ba Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 7 Jan 2022 04:01:50 +0100 Subject: [PATCH 2/3] Upgrade version --- check_process | 4 ++++ manifest.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 904ffa6..80f72b5 100644 --- a/check_process +++ b/check_process @@ -16,6 +16,8 @@ # upgrade=1 from_commit=103b86aa716d289cab00aee49e539cab252e21a3 # 0.0.1-2021-02-17~ynh1 # upgrade=1 from_commit=e9864a6c794ba3ec5e6359b298d299f513a157e7 + # 0.0.1.2021.12.28~ynh1 + upgrade=1 from_commit=3409d4986706a0b89c36447a2f435f4cd8dde155 backup_restore=1 multi_instance=1 port_already_use=0 @@ -30,3 +32,5 @@ Notification=none name=0.0.1-2020-12-24~ynh1 ; commit=e9864a6c794ba3ec5e6359b298d299f513a157e7 name=0.0.1-2021-02-17~ynh1 + ; commit=3409d4986706a0b89c36447a2f435f4cd8dde155 + name=0.0.1.2021.12.28~ynh1 diff --git a/manifest.json b/manifest.json index 4ebe38e..db7e243 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Search engine for PeerTube videos and channels", "fr": "Moteur de recherche de vidéos et chaînes PeerTube" }, - "version": "0.0.1.2021.12.28~ynh1", + "version": "0.0.1.2021.12.28~ynh2", "url": "https://search.joinpeertube.org/", "upstream": { "license": "AGPL-3.0-only", From 96274df4ded662ec4ec8a6134927cb0f9731b036 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 7 Jan 2022 03:01:55 +0000 Subject: [PATCH 3/3] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4358a7f..519aeef 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A search engine for [PeerTube](https://joinpeertube.org/) videos and channels, developed by Framasoft. -**Shipped version:** 0.0.1.2021.12.28~ynh1 +**Shipped version:** 0.0.1.2021.12.28~ynh2 **Demo:** https://search.joinpeertube.org/ diff --git a/README_fr.md b/README_fr.md index aab6501..d654553 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour A search engine for [PeerTube](https://joinpeertube.org/) videos and channels, developed by Framasoft. -**Version incluse :** 0.0.1.2021.12.28~ynh1 +**Version incluse :** 0.0.1.2021.12.28~ynh2 **Démo :** https://search.joinpeertube.org/