From 83f588cf376d61cd4ceb9144aec234a50ba3c2d5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Oct 2021 17:59:17 +0200 Subject: [PATCH 1/8] Update upgrade --- scripts/upgrade | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6a2ebab..5ee34e0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,18 +32,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# 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 #================================================= @@ -58,6 +46,18 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= From fe4c3af4251e96b497869fd4c486173ce4caa0e3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Nov 2021 20:34:36 +0100 Subject: [PATCH 2/8] 4.3 --- conf/arm5.src | 6 ------ conf/arm6.src | 6 ------ conf/{arm7.src => armhf.src} | 0 manifest.json | 2 +- scripts/_common.sh | 28 ---------------------------- scripts/backup | 6 ++++++ scripts/install | 11 ++++++++++- scripts/remove | 8 ++++++++ scripts/restore | 7 +++++++ scripts/upgrade | 16 +++++++++++++++- 10 files changed, 47 insertions(+), 43 deletions(-) delete mode 100644 conf/arm5.src delete mode 100644 conf/arm6.src rename conf/{arm7.src => armhf.src} (100%) diff --git a/conf/arm5.src b/conf/arm5.src deleted file mode 100644 index cf88e5f..0000000 --- a/conf/arm5.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/miniflux/v2/releases/download/2.0.33/miniflux-linux-armv5 -SOURCE_SUM=f0e11903bb3688ab4aa08746b4f904c9a71c94d5f005cc4f5d3fdbb58745c3de -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=miniflux -SOURCE_EXTRACT=false \ No newline at end of file diff --git a/conf/arm6.src b/conf/arm6.src deleted file mode 100644 index d800dcd..0000000 --- a/conf/arm6.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/miniflux/v2/releases/download/2.0.33/miniflux-linux-armv6 -SOURCE_SUM=7aa84c40f3b272cd67c1a599710e8979e08bb715360d065b4578fc5c6a97d9c3 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=miniflux -SOURCE_EXTRACT=false \ No newline at end of file diff --git a/conf/arm7.src b/conf/armhf.src similarity index 100% rename from conf/arm7.src rename to conf/armhf.src diff --git a/manifest.json b/manifest.json index f001844..34da818 100644 --- a/manifest.json +++ b/manifest.json @@ -19,7 +19,7 @@ "name": "eric_G" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 637d1d0..52491aa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -18,31 +18,3 @@ pkg_dependencies="postgresql apt-transport-https" #================================================= # FUTURE OFFICIAL HELPERS #================================================= - -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="amd64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="386" - elif [ -n "$(uname -m | grep armv7)" ]; then - architecture="arm7" - elif [ -n "$(uname -m | grep armv6)" ]; then - architecture="arm6" - elif [ -n "$(uname -m | grep armv5)" ]; then - architecture="arm5" - else - architecture="unknown" - fi - echo $architecture -} diff --git a/scripts/backup b/scripts/backup index 2eaa6b2..5e97511 100644 --- a/scripts/backup +++ b/scripts/backup @@ -50,6 +50,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/systemd/system/$app.service" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index c7a7c73..3e98d1d 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -architecture=$(ynh_detect_arch) +architecture=$YNH_ARCH password=$YNH_APP_ARG_PASSWORD admin=$YNH_APP_ARG_ADMIN @@ -49,6 +49,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --app=$app --key=architecture --value=$architecture #================================================= # STANDARD MODIFICATIONS @@ -126,6 +127,14 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_systemd_config +#================================================= +# 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 2dd7723..d7b5848 100644 --- a/scripts/remove +++ b/scripts/remove @@ -75,6 +75,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..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 084d5fb..929e0ef 100644 --- a/scripts/restore +++ b/scripts/restore @@ -99,6 +99,13 @@ ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app --description="Minimalist feed reader" --log="/var/log/$app/$app.log" +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." ---weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5ee34e0..f916b9f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -architecture=$(ynh_detect_arch) +architecture=$(ynh_app_setting_get --app=$app --key=architecture) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) @@ -51,6 +51,12 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# If architecture doesn't exist, create it +if [ -z "$architecture" ]; then + architecture="dpkg --print-architecture" + architecture=$(ynh_app_setting_get --app=$app --key=architecture) +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -114,6 +120,14 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2 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 #================================================= From a40d5b83708b345e44d2a7732b17478fd3b8e07a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 18 Nov 2021 18:49:41 +0100 Subject: [PATCH 3/8] Fix --- conf/nginx.conf | 5 ----- scripts/upgrade | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index a7548a2..c8e732d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,6 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:__PORT____PATH__/; proxy_redirect off; proxy_set_header Host $host; diff --git a/scripts/upgrade b/scripts/upgrade index f916b9f..6306889 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,7 +53,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If architecture doesn't exist, create it if [ -z "$architecture" ]; then - architecture="dpkg --print-architecture" + architecture=$YNH_ARCH architecture=$(ynh_app_setting_get --app=$app --key=architecture) fi From 41fe80b74c36a519c8b87d368bd4ce5f893a6343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 29 Nov 2021 18:11:48 +0100 Subject: [PATCH 4/8] Update scripts/upgrade Co-authored-by: Alexandre Aubin --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6306889..66d61d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -architecture=$(ynh_app_setting_get --app=$app --key=architecture) +architecture=$YNH_ARCH db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) From a6cb0401c1e417c761cd54c44515e7bff1547d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 29 Nov 2021 18:12:05 +0100 Subject: [PATCH 5/8] Update scripts/upgrade Co-authored-by: Alexandre Aubin --- scripts/upgrade | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 66d61d6..8fe5a72 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,12 +51,6 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If architecture doesn't exist, create it -if [ -z "$architecture" ]; then - architecture=$YNH_ARCH - architecture=$(ynh_app_setting_get --app=$app --key=architecture) -fi - # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all From ed1865f7080c67c6c2fcf6ea8eddbbb0d1728306 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 12 Dec 2021 22:12:32 +0100 Subject: [PATCH 6/8] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 929e0ef..f0e9ae3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ yunohost service add $app --description="Minimalist feed reader" --log="/var/log #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." ---weight=1 +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" From e37148d62389427055c5bdbb4eed86ddac07e3f9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 13 Dec 2021 07:31:11 +0100 Subject: [PATCH 7/8] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 34da818..162bb5b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Minimalist and opinionated RSS feed reader", "fr": "Agrégateur de flux RSS minimaliste" }, - "version": "2.0.33~ynh1", + "version": "2.0.33~ynh2", "url": "https://miniflux.app/", "upstream": { "license": "Apache-2.0", From 8ef7ae05ea60b0249f0ae09c3821f828b484db85 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 13 Dec 2021 06:31:19 +0000 Subject: [PATCH 8/8] 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 d573527..d529669 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Minimalist and opinionated RSS feed reader -**Shipped version:** 2.0.33~ynh1 +**Shipped version:** 2.0.33~ynh2 diff --git a/README_fr.md b/README_fr.md index 96d2923..6487124 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Minimalist and opinionated RSS feed reader -**Version incluse :** 2.0.33~ynh1 +**Version incluse :** 2.0.33~ynh2